package com.cavy.platform.server.dto;

import lombok.Data;

import java.util.Objects;

/**
 * agent在线时间
 */
@Data
public class AgentOnlineDto extends AgentDto {
    private long lastHeartbeat = 0;

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;

        AgentOnlineDto that = (AgentOnlineDto) o;

        return Objects.equals(getAggregateId(), that.getAggregateId());
    }

    @Override
    public int hashCode() {
        int result = super.hashCode();
        result = 31 * result + (getAggregateId() != null ? getAggregateId().hashCode() : 0);
        return result;
    }
}
